﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/meta.tpl"-}
<title>底部作品推荐 - 后台</title>
</head>

<body>
<div class="sAll">

{-include file="`$__PHY_WEB``$__DIR_ADM`/block/header.tpl"-}
{-php-}include(__PHY_WEB.__DIR_ADM."/block/menu.php");{-/php-}
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/menu.tpl" uL=$rNav-}

<div class="sL">
	<div class="sW main">
<!-- <main> -->
{- if $sMsg -}{- include file="`$__PHY_WEB``$__DIR_ADM`/block/message.tpl" -}{- /if -}

{- if 'list'==$sAction -}
<div class="sL list">
	<p>列表</p>
	<table>
		<tr class="capt">
			<td>序号</td>
			<td>作品ID</td>
			<td>作品名称</td>
			<td><a href="?action=new">添加</a></td>
		</tr>
{-section name=i loop=$rList-}
		<tr>
			<td>{-$rList[i].rank-}</td>
			<td>{-$rList[i].work_id-}</td>
			<td><a href="../f_unit/work.php?action=edit&id={-$rList[i].work_id-}">{-$rList[i].work_title|escape:html-}</a></td>
			<td><a href="?action=edit&id={-$rList[i].id-}">修改</a></td>
		</tr>
{-/section-}
		<tr class="capt">
			<td>序号</td>
			<td>作品ID</td>
			<td>作品名称</td>
			<td><a href="?action=new">添加</a></td>
		</tr>
	</table>
</div>
{- elseif 'edit'==$sAction -}
<div class="sL edit">
	<p>修改作品推荐</p>
	<table>
		<form method="post" action="?" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{-$rOne.id|escape:html-}" />
		<tr>
			<td class="indc">序号：</td>
			<td><select name="rank">
{-section name=i loop=$rSlctRanks-}
{-if $rOne.work_id==$rSlctRanks[i].work_id-}
				<option value="{-$rSlctRanks[i].rank-}" selected="selected">{-$rSlctRanks[i].rank-} 【当前位置】</option>
{-else-}
				<option value="{-$rSlctRanks[i].rank-}">{-$rSlctRanks[i].rank-}</option>
{-/if-}
{-/section-}
			</select></td>
		</tr>
		<tr>
			<td class="indc">作品ID：</td>
			<td><input type="text" name="work_id" value="{-$rOne.work_id|escape:html-}" /></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="update" />
				<input type="submit" name="action" value="delete" onclick="return confirm('确定要删除吗？');" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
		</form>
	</table>
</div>
{- elseif 'new'==$sAction -}
<div class="sL edit">
	<p>修改作品推荐</p>
	<table>
		<form method="post" action="?" enctype="multipart/form-data">
		<tr>
			<td class="indc">序号：</td>
			<td><i>默认加到最后</i></td>
		</tr>
		<tr>
			<td class="indc">作品ID：</td>
			<td><input type="text" name="work_id" value="{-$rOne.work_id|escape:html-}" /></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="add" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
		</form>
	</table>
</div>
{- else -}
sth wrong: no $sAction.
{- /if -}

<!-- </main> -->
	</div>
</div>

{- include file="`$__PHY_WEB``$__DIR_ADM`/block/footer.tpl" -}

</div><!-- end all -->
</body>
</html>
